<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>祈贝健康--后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/animate.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style-responsive.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" />
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="./Public/Admin/assets/plugins/pace/pace.min.js"></script>
    <!-- ================== END BASE JS ================== -->
</head>
<body>
<?php include './Public/Admin/header.html'; ?>



<!-- begin #content -->
<div id="content" class="content">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a href="javascript:;"><?php echo (L("homepage")); ?></a></li>
        <li><a href="javascript:;"><?php echo (L("merchant")); ?></a></li>
        <li class="active"><?php echo (L("account")); ?></li>

    </ol>

    <!-- end breadcrumb -->
    <!-- begin page-header -->
    <h1 class="page-header"><?php echo (L("merchant")); ?> <small><?php echo (L("account")); ?></small></h1>
    <!-- end page-header -->

    <!-- begin row -->
    <div class="row">
        <!-- begin col-12 -->
        <div class="col-md-12">
            <!-- begin panel -->
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title"><?php echo (L("account")); ?></h4>
                </div>

                <!-- Large button group -->


                <div class="panel-body">
                    <div class="row">
                        <div class='form-group'>
                            <label for='inputtext' class='col-md-2  control-label'><?php echo (L("currency")); ?>&nbsp;&nbsp;&nbsp;<strong style="font-size: 30px;color:#f60" id="bz">""</strong></label>
                            <label for='inputtext' class='col-md-4 col-md-offset-3 control-label'><?php echo (L("balance")); ?>:&nbsp;&nbsp;&nbsp;<strong style="font-size: 50px;color:#f60" id="yue">0.00</strong></label>
                            <br/><br/><label for='inputtext' class='col-md-3 control-label'><?php echo (L("withdraw")); ?>:&nbsp;&nbsp;&nbsp;<strong style="font-size: 20px;color:#0d83f0" id="tx">0.00</strong></label>
                        </div>
                    </div>



                    <div class="panel-body">

                        <br/><br/><br/>
                        <div class="row">
                            <div class='form-group'>
                                <div class="col-md-4 col-md-offset-3">
                                    <input type="text" id="txtsSearch" class="form-control" placeholder="<?php echo (L("minimum")); ?>" size="4" maxlength="10"/>
                                </div>
                                <div class="col-md-4">
                                    <a href="javascript:;" class="btn btn-primary btn-md" onclick="caozuo()"><?php echo (L("implement")); ?></a>
                                </div>
                            </div>
                        </div>
                        <br/><br/>
                        <div class="row">
                            <div class='form-group'>
                                <div class="col-md-12 col-md-offset-2" id="money">

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <!-- end panel -->
            </div>
            <!-- end col-12 -->
        </div>
        <!-- end row -->
    </div>
    <!-- end #content -->


    <!-- begin scroll to top btn -->
    <a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
    <!-- end scroll to top btn -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="./Public/Admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="./Public/Admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="./Public/Admin/assets/crossbrowserjs/html5shiv.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/respond.min.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="./Public/Admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="./Public/Admin/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="./Public/Admin/assets/plugins/DataTables/js/dataTables.colVis.js"></script>
<script src="./Public/Admin/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>
    $(document).ready(function() {
        App.init();
        loads();
    });
    function loads(){
        $.getJSON("index.php?m=Admin&c=ShopAccount&a=get_money",function(result){
            if(result!=0){
                $("#bz").html(result.bz);
                $("#yue").html(result.money);
                $("#tx").html(result.cash);
            }
        });
        $.getJSON("index.php?m=Admin&c=ShopAccount&a=get_money_list",function(result){
            var html='';
            if(result!=0){
                $.each(result, function(key, val) {
                    //如果等于1说明财务，已经汇款
                    html+='<label for="inputtext" class="col-md-12 control-label"><?php echo (L("mer")); ?> &nbsp;'+" &nbsp; &nbsp;"+val.bulid_time +'<?php echo (L("took")); echo (L("wit")); ?> &nbsp;'+val.money+'<?php echo (L("deduct")); ?> &nbsp;'+val.s_money+'<?php echo (L("fee")); echo (L("finally")); ?>'+val.true_money;
                    if(val.update_time == 1){

                        html=html+'<?php echo (L("pls")); ?></label><br/>';
                    }else{
                        html=html+"</label><br/>";
                    }
                    $("#money").html(html);
                });

            }

        });

    }
    function caozuo(){
        if($("#txtsSearch").val()<5000){
            alert("<?php echo (L("insufficient")); ?>");return;
        }
        if(confirm("<?php echo (L("operation")); ?>")){
            $.getJSON("index.php?m=Admin&c=ShopAccount&a=confirm&money="+$("#txtsSearch").val(),function(result){
                if(result==1){
                    location.reload();
                }else if(result==2){
                    alert("<?php echo (L("insufficient")); ?>");
                }else if(result==3){
                    alert("<?php echo (L("insufficient")); ?>");
                }
            });
        }
    }
</script>
</body>
</html>